
class MyQueue:

    def __init__(self, max_size):
        self.queueList = list()
        self.maxSize = max_size
        self.length = 0

    def push(self, item):
        if self.length == self.maxSize:
            print("数组已满!")
            return
        elif len(self.queueList) == 0:
            self.queueList.insert(0, item)
        else:
            self.queueList.append(item)
        self.length += 1

    def pop(self):
        if self.length == 0:
            print("数组已经空了!")
            return
        self.queueList.pop(0)
        self.length -= 1

    def delete(self, index):
        self.queueList.remove(index)
        self.length -= 1

    def print(self):
        length = len(self.queueList)
        if length == 0:
            print("数组为空！")
            return

        for i in range(0, length):
            print("%s " % {self.queueList[i]}, end="")
        print()


if __name__ == '__main__':
    lt = MyQueue()
    lt.push(0)
    lt.push(1)
    lt.print()

    # 出栈
    lt.pop()
    lt.print()

    # 出栈
    lt.pop()
    lt.print()
